<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Grom Hellscream
 * Date: 11/2/12
 * Time: 11:33 AM
 * To change this template use File | Settings | File Templates.
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.tooltip');

$donvi = $this->get('donvi');
$khoi = $this->get('khoi');

$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . 'components/com_vast/assets/autocomplete/meio.aucomplete.css');
$document->addStyleSheet(JURI::root() . 'components/com_vast/assets/css/jquery.autocomplete.css');
$document->addStyleSheet(JURI::root() . 'components/com_vast/assets/css/thickbox.css');

$document->addScript(JURI::root() . 'components/com_vast/assets/autocomplete/Builder.js');

$document = JFactory::getDocument();
$autocompleteDir = JURI::root() . '/components/com_vast/assets/autocomplete/';

$tongiaoJSON = $this->get('tongiaoJSON');
$dantocJSON = $this->get('dantocJSON');

$script=<<<AUTOCOMPLETE
    Builder.build('{$autocompleteDir}', {
        Source: [
            'BGIFrame',
            'Meio.Autocomplete'
        ]
    });
    window.addEvent('domready', function() {
        var data = [
            {$tongiaoJSON}
        ];

        var instance = new Meio.Autocomplete($('jform_tongiao'), data, {
            selectOnTab: false,
            onNoItemToList: function(elements){
                elements.field.node.highlight('#ff0000');
            },
            filter: {
                type: 'contains',
                path: 'text'
            }
        });        
    });
    
    window.addEvent('domready', function() {
        var data = [
            {$dantocJSON}
        ];

        var instance = new Meio.Autocomplete($('jform_dantoc'), data, {
            selectOnTab: false,
            onNoItemToList: function(elements){
                elements.field.node.highlight('#ff0000');
            },
            filter: {
                type: 'contains',
                path: 'text'
            }
        });        
    });    
AUTOCOMPLETE;

$document->addScriptDeclaration($script);

?>

<div id="crumbs">
    <div style="color: #222222;font-weight: normal;margin: 0;padding: 0">
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=vast') ?>">Trang chủ</a> »
        <span>Cơ cấu tổ chức</span> »
        <?php if (isset($khoi)): ?>        
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=donvitructhuoc&id=' . $khoi->id); ?>"><?php echo $khoi->ten ?></a> »                
        <?php endif; ?>
        <?php if (isset($donvi)): ?>        
        <a href="<?php echo JRoute::_('index.php?option=com_vast&view=phongtructhuoc&id=' . $donvi->id); ?>"><?php echo $donvi->ten ?></a> »                
        <?php endif; ?>
        <span>Thêm nhân viên vào đơn vị</span>
    </div>
</div>

<div id="main" class="home">

<h3 class="title green">Thêm nhân viên vào làm việc tại đơn vị <?php echo $donvi->ten ?></h3>

<div class="form">
    <form class="commentform" action="<?php echo JRoute::_('index.php?option=com_vast&view=themnhanvienvaodonvi&donviid=' . $donvi->id); ?>" method="post" id="themnhanvienvaodonvi" name="themnhanvienvaodonvi">

        <div class="row">
            <?php echo $this->form->getLabel('id'); ?>
            <?php echo $this->form->getInput('id'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('chucdanh'); ?>
            <?php echo $this->form->getInput('chucdanh'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('batdau'); ?>
            <?php echo $this->form->getInput('batdau'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('ketthuc'); ?>
            <?php echo $this->form->getInput('ketthuc'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('tinhtranglamviec_id'); ?>
            <?php echo $this->form->getInput('tinhtranglamviec_id'); ?>
        </div>

        <div class="row">
            <?php echo $this->form->getLabel('hoten'); ?>
            <?php echo $this->form->getInput('hoten'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('gioitinh'); ?>
            <?php echo $this->form->getInput('gioitinh'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('ngaysinh'); ?>
            <?php echo $this->form->getInput('ngaysinh'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('taikhoandientu'); ?>
            <?php echo $this->form->getInput('taikhoandientu'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('sohieu'); ?>
            <?php echo $this->form->getInput('sohieu'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('chungminhnhandan'); ?>
            <?php echo $this->form->getInput('chungminhnhandan'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('ngaycap'); ?>
            <?php echo $this->form->getInput('ngaycap'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('noicap'); ?>
            <?php echo $this->form->getInput('noicap'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('masothue'); ?>
            <?php echo $this->form->getInput('masothue'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('noisinh'); ?>
            <?php echo $this->form->getInput('noisinh'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('nguyenquan'); ?>
            <?php echo $this->form->getInput('nguyenquan'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('diachihientai'); ?>
            <?php echo $this->form->getInput('diachihientai'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('dienthoai'); ?>
            <?php echo $this->form->getInput('dienthoai'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('didong'); ?>
            <?php echo $this->form->getInput('didong'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('thudientu'); ?>
            <?php echo $this->form->getInput('thudientu'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('dantoc'); ?>
            <?php echo $this->form->getInput('dantoc'); ?>
        </div>
            
        <div class="row">
            <?php echo $this->form->getLabel('tongiao'); ?>
            <?php echo $this->form->getInput('tongiao'); ?>
        </div>
        
        <div class="row">
            <input type="hidden" name="donviid" value="<?php echo $donvi->id; ?>" />
            <input type="hidden" name="option" value="com_vast" />
            <input type="hidden" name="task" value="themnhanvienvaodonvi.submit" />
        </div>
        <div class="row buttons">
            <button id="submit" type="submit" class="button"><?php echo JText::_('Thêm nhân viên'); ?></button>
            <?php echo JHtml::_('form.token'); ?>
        </div>
    </form>
</div>
<div class="clr"></div>
</div>